package ru.st.selenium.applogic;


import ru.st.selenium.applogic.ApplicationManager;

public class NavigationHelper extends DriverBasedHelper  {

  private String baseUrl;

  public NavigationHelper(ApplicationManager manager) {
    super(manager.getWebDriver());
    this.baseUrl = manager.getBaseUrl();
  }
  
  public void openMainPage() {
    driver.get(baseUrl);
  }

  public void openRelativeUrl(String url) {
    driver.get(baseUrl + url);
  }
  
  public void gotoUserProfilePage() {
    pages.internalPage.ensurePageLoaded().clickUserProfilePage();
    //driver.findElement(By.cssSelector("nav a[href $= '?go=profile']"))
    //  .click();
    // openRelativeUrl("?go=profile");
  }

  public void gotoUserManagementPage() {
    pages.internalPage.ensurePageLoaded().clickUserManagementLink();
    //driver.findElement(By.cssSelector("nav a[href $= '?go=users']"))
    //  .click();
    //openRelativeUrl("?go=users");
  }

}
